version 1.0
import "sub.wdl" as sub

workflow test{
    input{
	String a1 ='ssss'
	File b1
    Array[Int] b = [0,1,2]
    Boolean xout = false 
	String out1 = a1 + 'tt'
    }

	call task_A as tt  { input: a=a1, b=b1, out=out1}
    if ( xout ){
    	call task_A as tt2  { input: a=a1, b= tt.outfile, out=out1}
    }
    scatter(i in b){
        call task_A as tt5{ input: a=i , b= b1, out=out1}
    }
    call sub.test as tt3 { input: a1=a1 , b1=b1 , out1=tt.outfile}
    call task_A as tt4 { input: a = a1 , b = b1 , out = tt3.out}
    
    output{
        File out = tt.outfile
        File out2=tt4.outfile
    }
    parameter_meta{
        a1: {description: "The samplesheet, including sample ids, library ids, readgroup ids and fastq file locations.",
                           category: "required"}    
    }
    meta{
        author:"liutao"
    }

}


task task_A {
    input{
    String a='a'
    File b='b'
    String out
    }
    command {
    echo ${a} ${b} >${out}.txt
    }
    output {
    File outfile="${out}.txt"
    }
}

